<template>
	<view class="">
		<scroll-view class="main" scroll-y="true">
			<view>
				<view style="width: 93%;height:280rpx;margin: 0 auto;background-color: #fff;border-radius: 15rpx; padding-right: 15rpx;">
					<view class="top" style="width: 90%;float: left;">
						<view>
							<text class="title" style="font-size: 32rpx;">{{plateDetail.nameofPark}}</text>
						</view>
						<view>
							<text class="creator">营业状态：{{plateDetail.marketingSituation ? plateDetail.marketingSituation : '暂无'}}</text>
						</view>	
						<view>
							<text class="creator">园区类型：{{plateDetail.parkType ? plateDetail.parkType : '暂无'}}</text>
						</view>	
						<view>
							<text class="creator">主导产业：{{plateDetail.primeMoverIndustry ? plateDetail.primeMoverIndustry : '暂无'}}</text>
						</view>	
						<view>
							<text class="creator">申报年份：{{plateDetail.year ? plateDetail.year : '暂无'}}</text>
						</view>	
					</view>
				</view>
				<view class="content">
					<scroll-view style="height: 100%;" scroll-y="true" >
						<view>
							<text class="title">园区简介</text>
							<view>
								<text class="creator">{{plateDetail.platformIntroduction ? plateDetail.platformIntroduction :'暂无'}}</text>
							</view>
							<text class="title">基本条件</text>
							<view>
								<text class="creator">{{plateDetail.basicCondition ? plateDetail.basicCondition :'暂无'}}</text>
							</view>
							<text class="title">园区效益</text>
							<view>
								<text class="creator">{{plateDetail.benefit ? plateDetail.benefit :'暂无'}}</text>
							</view>
							<text class="title">园区位置</text>
							<view>
								<text class="creator">{{plateDetail.basicCondition ? plateDetail.basicCondition :'暂无'}}</text>
							</view>
						</view>
					</scroll-view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	
	function getDate(type) {
		const date = new Date();
	 
		let year = date.getFullYear();
		let month = date.getMonth() + 1;
		let day = date.getDate();
	 
		if (type === 'start') {
			year = year - 10;
		} else if (type === 'end') {
			year = year + 10;
		}
		month = month > 9 ? month : '0' + month;
		day = day > 9 ? day : '0' + day;
	 
		return `${year}-${month}-${day}`;
	}
	
	import env from '../../../utils/env';
	import * as data from "@/api/system/dict/data" 
	import * as zone from "@/api/innovate/zone.js"; //重点实验室

    export default {
		components: {
		},
		data() {
			return {
				plateDetail: {},
				categaryLisy:[],
				// showPopup:false,
				popupType: 'top',
				plateId:'',
				orderStatus:0,
				//截止时间选择相关
				date: getDate({
					format: true
				}),
				startDate: getDate('start'),
				endDate: getDate('end'),
				phone:'',
				detail:'',
				orderInfo:{
						details: '',//订单详情描述
						orderType: '',//订单类型
						serverId: '',//服务ID
						serverName: '',//服务名称
						subscribeDate: '',//预约时间
						userId: '',//下单人ID
						userName: '',//下单人名字
						userTelphone:''//下单人电话
				},
				showMask: false,
			}
		},
		onLoad(option) {
			this.plateId = option.id
			this.getPlateDetail(option.id);
			// this.getUser()
		},
		methods:{
			getPlateDetail(id){
				zone.getStpzdsys(id).then((res)=>{
					this.plateDetail = res.data
				})
			},
			toggle(popupType) {
				console.log("弹窗")
			    this.popupType = popupType;
			    // this.$refs['orderpopup'].open();
				this.showMask = true
			},
			closePopup() {
				// this.$refs['orderpopup'].close();
				this.showMask = false
			},
			change(e) {
			},
			bindDateChange(e) {
				this.date = e.detail.value;
			},
			submitOrder(){
				if(this.orderInfo.userTelphone == ''){
					uni.showToast({
						icon:"none",
						title:"联系电话不能为空！"
					})
				}else{
					this.orderInfo.serverId = this.plateDetail.id
					this.orderInfo.serverName = this.plateDetail.mInstruCHNName
					order.addORDER(this.orderInfo).then((res)=>{
						if(res.code == '200'){
							uni.navigateTo({
								url:'/subpages/pages/my/orderList/order_list'
							})
						}else{
							uni.showToast({
								icon:'none',
								title:'提交失败，请稍后重试！'
							})
						}
					})
				}
			}
		}
	}
	
</script>

<style>
	
	.main {
		width: 100vw;
		height: 100vh;
		background-color: #e0e0e0;
		padding-top: 25rpx;
	}
	
	image {
		width: 100%;
	}
	
	.top{
		height: 80rpx;
/* 		margin-top: 15rpx; */
		padding-left: 25rpx;
		padding-top: 25rpx;
		background-color: #fff;
	}
	
	.type{
		height:80rpx;
		background-color: #fff;
		float: left;
		margin-top: 15rpx;
		padding-top: 15rpx;
	}
	
	.content{
		width: 87%;
		height:820rpx;
		background-color: #fff;
		margin: 25rpx auto;
		border-radius: 15rpx;
		padding: 25rpx;
	}
	
	.title {
		font-size: 28rpx;
		font-weight: 700;
		width: 100%;
		padding-top:15rpx;
		padding-left: 8rpx;
		color:#306caa;
		float: left;
	}
	
	.creator {
		width: 100%;
		font-size: 25rpx;
		padding: 8rpx;
		float: left;
	}
	
	.publishTime {
		font-size: 25rpx;
		padding: 8rpx;
		float: right;
	}
	
	.detail_content {
		margin-top: 8rpx;
/* 		text-indent: 2em; */
		line-height: 50rpx;
		justify-content: flex-start;
		padding: 25rpx;
	}
	
	.form-left{
		margin-left: 16px;
		padding:5rpx 0;
	}
	
	.form-right{
		margin-top: 6px;
		margin-left: 6px;
		padding:5px 0;
		width: 90%;
		border: 1px solid #D8D8D8;
		border-radius: 3px;
	}
	
	.uni-form-item {
		margin: 60rpx 30rpx;
		border-radius: 50px;
		}
		
	.submit_view {
		height: 90rpx;
	}
		
	.submit_view .submit{
		background-color: #016fb8;
		height: 70rpx;
		width: 40%;
		font-size: 28rpx;
		margin-top: 20rpx;
		float: left;
	}
	.submit_view .canncle{
		background-color: darkgray;
		height: 70rpx;
		width: 40%;
		font-size: 28rpx;
		margin-top: 20rpx;
		float: right;
	}
	
	.login_from_input{
		width: 100%; 
		height:auto; 
		display: flex; 
		flex-direction: row; 
		justify-content: space-between; 
		align-items: center; 
		border-bottom: 1px #eee solid; 
		padding: 20upx 0px; 
		margin: 0px auto; 
		background-color: #fff;
	} 
	
	.login_from_name{
		width: 40%; 
		margin-left: 40rpx;
		font-size: 30rpx;
	}
	.login_from_fun{ 
		width: 60%; 
		display: flex; 
		flex-direction: row; 
		justify-content: flex-end; 
		text-align: right; 
		margin-left: 25rpx;
	}
	
	.login_from_fun input{ 
		width: 100%; 
		text-align: left; 
		font-size: 14px;  
	}
	
	/deep/ .uni-popup .uni-popup__wrapper {
	    width: 70% !important;
		margin: 0 auto;
	}
	
	.price {
		width: 100%;
		background-color: #c6e2ff;
		font-size: 25rpx;
		color:#ff4444;
		padding: 8rpx;
		border-radius: 8rpx;
	}
	
	.devideline {
		float: left;
		height: 0.3rpx;
		width:100%;
		background-color: #eeeeee;
		margin-top: 15rpx;
		margin-bottom: 15rpx;
	}
	
	.btn_order{
		position: fixed;
		top: 525rpx;
		right: 30rpx;
		margin-right: 15rpx; 
		width: 100px;
		text-align: center; 
		float: right;
	}
	
	.maskClass {
		position:fixed;
		bottom:0;
		top:0;
		left:0;
		right:0;
		background-color:rgba(0, 0, 0, 0.5);
		z-index: 2;
	}	
</style>